{__NOLAYOUT__}
<layout name="layoutPC" />
<div class="container-fluid" ng-controller="resumeController">
<div class="row">
<div class="col-sm-8 col-sm-offset-2 text-center">
    <h1 class="main-title" style="font-size: 32px;">
        完善资料，有助于您扩展人脉圈！
    </h1>
</div>
<input type="hidden" id="resumeId" value="{{resumeBase.resume_id}}">
<!-- <h1>{{resumeBase.resume_id}}</h1> -->
<div class="col-sm-8 col-sm-offset-2 text-center" style="margin-top: 45px;padding: 0px">
<div class="line-box">
    <div style="width: 27%;position: absolute;top: -27px;left: 0px; z-index: 99;">
        <div style="border: 1px solid rgb(228,228,228);border-radius: 6px;padding: 7px 25px;font-size: 23px;text-align: center;font-weight: 400;background-color: #ffffff;float: right">
            个人资料
        </div>
    </div>

    <div class="information-display row" style="padding-top: 45px">
        <div class="col-sm-3 title">
            性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别
        </div>
        <div class="col-sm-7 content">
            <span>{{ resumeBase.sexMeaning }}</span>
        </div>
        <div class="col-sm-2">
            <a href="<{:U('Resume/modifyPC')}>" class="blue-link" style="font-size: 18px">修改</a>
        </div>
    </div>
    <div class="information-display row">
        <div class="col-sm-3 title">
            真实姓名
        </div>
        <div class="col-sm-9 content">
            {{ resumeBase.user_name }}
        </div>
    </div>
    <div class="information-display row">
        <div class="col-sm-3 title">
            出生年份
        </div>
        <div class="col-sm-9 content">
            {{ resumeBase.birthday }}年
        </div>
    </div>
    <div class="information-display row">
        <div class="col-sm-3 title">
            现居住地
        </div>
        <div class="col-sm-9 content">
            {{ resumeBase.address }}
        </div>
    </div>
    <div class="information-display row">
        <div class="col-sm-3 title">
            学历信息
        </div>
        <div class="col-sm-9 content">
            {{ resumeBase.degreeMeaning }}
        </div>
    </div>
    <div class="information-display row">
        <div class="col-sm-3 title">
            岗位、时限筛选
        </div>
        <div class="col-sm-9 content">
            <span>{{ resumeBase.jobs }}</span>
            <br ng-show="resumeBase.jobs">
            <span>{{ resumeBase.duration }}</span>
        </div>
    </div>
</div>
<hr style="margin:40px 0px;border-top: 1px solid rgb(228,228,228); "/>
<div class="text-center">
<!-- <div class="radio" style="font-size: 20px;color: #515151;">
    <label>
        <input type="radio" class="big-radio" name="isPublic" value="1" ng-model="isPublic">公开所有简历信息
    </label>
</div>
<div class="radio" style="font-size: 20px;color: #515151;">
    <label>
        <input type="radio" class="big-radio" name="isPublic" value="2" ng-model="isPublic">部分公开简历信息
    </label>
</div>
<div class="row">
    <div class="col-sm-8 col-sm-offset-2 text-left" style="font-size: 17px;color: #667077;margin-top: 20px">
        个人资料为公开信息，您可选择公开所有简历信息。
        <br/>
        部分公开信息即除官方认证的可信用户外，普通用户只能查看以下信息中的代表工作经历，希望浏览您所有信息的用户提交申请后，我们将第一时间以短信的时间通知您，您通过后，Ta才能浏览您的所有信息。
    </div>
</div> -->
<div class="row" style="margin-top: 65px">
    <div class="col-sm-12 text-center">
        <div class="line-box">
            <div class="line-box-title">
                自我介绍
            </div>
            <div class="row" style="margin-top: 40px;margin-bottom: 30px">
                <div class="col-sm-10 col-sm-offset-1 text-center">
                    <textarea class="big-input form-control" rows="4" id="inputIntro" ng-model="intro" placeholder="200字以内，建议填写个人优势及专长。"></textarea>
                </div>
            </div>
        </div>
        <div class="line-box" style="margin-top: 65px">
            <div class="line-box-title">
                工作经历
            </div>
            <div id="work-experience-container">
                <div class="row movable-row true droppable" ng-show="firstExperience" ng-id="{{firstExperience.exp_id}}" order="{{firstExperience.r_order}}">
                    <div class="col-sm-1 movable-icon">
                        <img src="__PUBLIC__/static/pc/img/icon_move.png" />
                    </div>
                    <div class="col-sm-10">
                        <div class="information-display row">
                            <div class="col-sm-3 title title-left">
                                项目名称/公司
                            </div>
                            <div class="col-sm-9 content" ng-show="!firstExperience.active">
                                {{ firstExperience.project_name }}
                            </div>
                            <div class="col-sm-9" ng-show="firstExperience.active">
                                <input type="text" class="form-control big-input" ng-model="firstExperience.newProjectName" placeholder="必填">
                            </div>
                        </div>
                        <div class="information-display row">
                            <div class="col-sm-3 title title-left">
                                工作职责
                            </div>
                            <div class="col-sm-9 content" ng-show="!firstExperience.active">
                                {{ firstExperience.role }}
                            </div>
                            <div class="col-sm-9" ng-show="firstExperience.active">
                                <input type="text" class="form-control big-input"  ng-model="firstExperience.newRole" placeholder="必填">
                            </div>
                        </div>
                        <div class="information-display row" >
                            <div class="col-sm-3 title title-left">
                                详细描述
                            </div>
                            <div class="col-sm-9 content" ng-show="!firstExperience.active">
                                {{firstExperience.description}}
                            </div>
                            <div class="col-sm-9" ng-show="firstExperience.active">
                                <textarea class="big-input form-control" rows="2" ng-model="firstExperience.newDescription" placeholder="可描述项目重要人物的参与，如明星等；项目经历了一些比较重大的事项；自己在此项目中的收获等"></textarea>
                            </div>
                        </div>
                        <div class="information-display row">
                            <div class="col-sm-3 title title-left">
                                作品链接
                            </div>
                            <div class="col-sm-9 content" ng-show="!firstExperience.active">
                                {{firstExperience.url}}
                            </div>
                            <div class="col-sm-9" ng-show="firstExperience.active">
                                <input type="text" class="form-control big-input" ng-model="firstExperience.newUrl" placeholder="把作品链接复制到此即可">
                            </div>
                        </div>
                        <div class="row" ng-show="firstExperience.active">
                            <div class="col-sm-12 text-left">
                                <div class="pics-uploaded" ng-show="firstExperience.active">
                                    <a ng-repeat="imageExp in expAttach[1]" href="javascript:;" class="link-img" tabindex="0"  data-placement="top" data-toggle="popover" title="操作" data-content="<a href='javascript:void(0)' onclick='javascript: angular.element(this).scope().delExpAttach({{firstExperience.exp_id}},{{ $index }})'>删除</a>">
                                        <img src="__UPLOAD__/{{ imageExp.image_url }}"/>
                                    </a>
                                </div>
                                <button type="button" class="btn-upload-file">上传附件
                                    <!-- <input type="file" /> -->
                                    <form name="{{firstExperience.exp_id}}" class="form-upload" action="<{:U('Upload/photoExpPC')}>" target="iframebox" enctype="multipart/form-data" method="post" >
                                        <input type="file" name="avatar" class="input-imgfile"
                                               onchange="expUploadCheck({{firstExperience.exp_id}});">
                                        <input type="hidden" name="exp_id" value="{{firstExperience.exp_id}}">
                                    </form>
                                </button>
                                <p class="help-block" style="display: inline-block">附件可上传作品截图或工作照</p>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-1" style="padding: 0px">
                        <a href="javascript:void(0);" class="blue-link" style="font-size: 18px" ng-show="!firstExperience.active" ng-click="modify(firstExperience)">修改</a>
                        <div class="row" ng-show="firstExperience.active">
                            <a href="javascript:void(0);" class="blue-link" style="font-size: 18px"  ng-click="save(firstExperience)">保存</a>
                        </div>
                        <div class="row" ng-show="firstExperience.active" style="margin-top: 10px">
                            <a href="javascript:void(0);" class="blue-link" style="font-size: 18px"  ng-click="cancel(firstExperience)">取消</a>
                        </div>
                    </div>
                </div>


                <div class="row movable-row true droppable" style="margin:40px 25px 10px" ng-repeat="exp in otherExperience" ng-id="{{ exp.exp_id }}" order="{{ exp.r_order }}">
                    <div class="col-sm-1 movable-icon">
                        <img src="__PUBLIC__/static/pc/img/icon_move.png" />
                    </div>
                    <div class="col-sm-10">
                        <div class="information-display row">
                            <div class="col-sm-3 title title-left">
                                项目名称/公司
                            </div>
                            <div class="col-sm-9 content" ng-show="!exp.active">
                                {{ exp.project_name }}
                            </div>
                            <div class="col-sm-9" ng-show="exp.active">
                                <input type="text" class="form-control big-input" ng-model="exp.newProjectName" placeholder="必填">
                            </div>
                        </div>
                        <div class="information-display row">
                            <div class="col-sm-3 title title-left">
                                工作职责
                            </div>
                            <div class="col-sm-9 content" ng-show="!exp.active">
                                {{ exp.role }}
                            </div>
                            <div class="col-sm-9" ng-show="exp.active">
                                <input type="text" class="form-control big-input"  ng-model="exp.newRole" placeholder="必填">
                            </div>
                        </div>
                        <div class="information-display row" ng-show="exp.active">
                            <div class="col-sm-3 title title-left">
                                详细描述
                            </div>
                            <div class="col-sm-9" >
                                <textarea class="big-input form-control" rows="2" ng-model="exp.newDescription" placeholder="选填，200字以内，可描述项目概况、项目经历的重大事项、自己经历本项目的成长等。"></textarea>
                            </div>
                        </div>
                        <div class="information-display row" ng-show="exp.active">
                            <div class="col-sm-3 title title-left">
                                作品链接
                            </div>
                            <div class="col-sm-9">
                                <input type="text" class="form-control big-input" ng-model="exp.newUrl" placeholder="选填">
                            </div>
                        </div>
                        
                        <div class="row" ng-show="exp.active">
                            <div class="col-sm-12 text-left">
                                <div class="pics-uploaded" ng-show="exp.active">
                                    <a ng-repeat="imageExp in expAttach[exp.exp_id]" href="javascript:;" class="link-img" tabindex="0"  data-placement="top" data-toggle="popover" title="操作" data-content="<a href='javascript:void(0)' onclick='javascript: angular.element(this).scope().delExpAttach({{exp.exp_id}},{{ $index }})'>删除</a>">
                                        <img src="__UPLOAD__/{{ imageExp.image_url }}"/>
                                    </a>
                                </div>
                                <button type="button" class="btn-upload-file">上传附件
                                    <!-- <input type="file" /> -->
                                    <form name="{{exp.exp_id}}" class="form-upload" action="<{:U('Upload/photoExpPC')}>"
                                          target="iframebox" enctype="multipart/form-data" method="post" >
                                        <input type="file" name="avatar" class="input-imgfile"
                                               onchange="expUploadCheck({{exp.exp_id}});">
                                        <input type="hidden" name="exp_id" value="{{exp.exp_id}}">
                                    </form>
                                </button>
                                <p class="help-block" style="display: inline-block">附件可上传作品截图或工作照</p>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-1" style="padding: 0px">
                        <a href="javascript:void(0);" class="blue-link" style="font-size: 18px" ng-show="!exp.active" ng-click="modify(exp)">修改</a>
                        <div class="row" ng-show="exp.active">
                            <a href="javascript:void(0);" class="blue-link" style="font-size: 18px"  ng-click="save(exp)">保存</a>
                        </div>
                        <div class="row" ng-show="exp.active" style="margin-top: 10px">
                            <a href="javascript:void(0);" class="blue-link" style="font-size: 18px"  ng-click="cancel(exp)">取消</a>
                        </div>
                    </div>
                </div>


                <!--可编辑的行-->
                <div class="row movable-row" id="edit-movable-row">
                    <div class="col-sm-1 padding-0">
                        <img src="__PUBLIC__/static/pc/img/icon_move.png" style="opacity: 0.3;"/>
                        <div class="movable-info">拖动排序</div>
                    </div>
                    <div class="col-sm-10">
                        <div class="row information-display">
                            <div class="col-sm-3 title title-left padding-top-10">
                                项目名称/公司
                            </div>
                            <div class="col-sm-9" style="margin-bottom: 5px;">
                                <input type="text" class="form-control big-input" ng-model="projectName" placeholder="必填">
                            </div>
                            <div class="col-sm-3 title title-left padding-top-10">
                                工作职责
                            </div>
                            <div class="col-sm-9">
                                <input type="text" class="form-control big-input" ng-model="role" placeholder="必填">
                            </div>
                            <div class="col-sm-3 title title-left padding-top-10">
                                详细描述
                            </div>
                            <div class="col-sm-9">
                                <textarea class="big-input form-control" rows="2" ng-model="description" placeholder="选填，200字以内，可描述项目概况、项目经历的重大事项、自己经历本项目的成长等。"></textarea>
                            </div>
                            <div class="col-sm-3 title title-left padding-top-10">
                                作品链接
                            </div>
                            <div class="col-sm-9">
                                <input type="text" class="form-control big-input" ng-model="url" placeholder="选填">
                            </div>
                        </div>
                        <div class="row" style="display:none;">
                            <div class="col-sm-12 text-left">
                                <!-- 新加简历 -->
                                <button type="button" class="btn-upload-file">上传附件
                                    <!-- <input type="file" /> -->
                                    <form name="firstExp" class="form-upload" action="<{:U('Upload/photoExpPC')}>"
                                          target="iframebox" enctype="multipart/form-data" method="post" >
                                        <input type="file" name="avatar" class="input-imgfile"
                                               onchange="expUploadCheck('firstExp');">
                                        <!-- <input type="hidden" name="exp_id" value="{{exp.exp_id}}"> -->
                                    </form>
                                </button>
                                <p class="help-block" style="display: inline-block">附件可上传作品截图或工作照</p>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-1" style="padding: 0px">
                        <a href="javascript:void(0);" class="blue-link" style="font-size: 18px" ng-click="addExp()">保存</a>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-offset-4 col-sm-8 text-left">
                        <div class="line-box-information" style="margin-bottom: 10px">
                            注：目前支持5项经历的添加描述/附件功能，
                            <br/>
                            排名在第一的工作经历将作为代表经历，出现在首页。
                        </div>
                    </div>
                </div>
            </div>


        </div>
        <!-- <div class="big-ckbx" style="font-size: 20px;margin: 30px auto;">
            <input type="checkbox"> 我是演员/模特/主持/配音，使用简历加项
        </div> -->
        <!-- <div class="line-box" ng-init="resumeId = '{{resumeBase.resume_id}}';">
            <div class="line-box-title">
                简历加项
            </div>
            <div class="row">
                <div class="col-sm-10 col-sm-offset-1 text-left" style="margin-top: 40px">
                    <span style="font-size: 20px;color: #5E5E5E;">照片</span>
                    <div class="pics-uploaded">
                        <a ng-repeat="image in images" href="javascript:;" class="link-img" tabindex="0"  data-placement="top" data-toggle="popover" title="操作" data-content="<a href='#' onclick='javascript: angular.element(this).scope().delAttach({{ $index }})'>删除</a>">
                            <img src="__UPLOAD__/{{ image.url }}" img-name="{{ image.name }}"/>
                        </a>
                        <button type="button" class="btn-upload-file" style="top:-8px">上传照片
                            <form name="imgUploadForm" class="form-upload" action="<{:U('Upload/photo')}>"
                                  target="iframebox" enctype="multipart/form-data" method="post" >
                                <input type="file" name="avatar" class="input-imgfile"
                                       onchange="uploadImgCheck()">
                                <input type="hidden" name="image_name" ng-model="spareId" value="{{ spareId }}">
                            </form>
                        </button>
                        <p class="help-block" style="display: inline-block;vertical-align: super;">规格要求：xxx</p>
                    </div>
                    <span style="font-size: 20px;color: #5E5E5E;">视频</span>
                    <div class="pics-uploaded">
                        <video style="width:230px;" controls="controls" src="__UPLOAD__/{{ attach.video_url1 }}"></video>
                        <button type="button" class="btn-upload-file" style="top:-8px">上传视频
                            <form name="videoUploadForm" class="form-upload" action="<{:U('Upload/media')}>"
                                  target="iframebox" enctype="multipart/form-data" method="post" >
                                <input type="file" name="avatar" class="input-imgfile" onchange="uploadVideoCheck()">
                            </form>
                        </button>
                    </div>
                    <div class="row">
                        <div class="col-sm-offset-3 col-sm-8 text-left">
                            <div class="line-box-information" style="margin-bottom: 10px">
                                注：目前支持上传8张照片及1个20秒以内的手机录制视频。
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div> -->
        <div class="row" style="margin-top: 40px">
            <div class="col-sm-4 col-sm-offset-4 text-center">
                <button class="btn-blue-line btn-lg btn-block" type="button" ng-click="submit()">完成</button>
            </div>
        </div>
    </div>
</div>
</div>
</div>
</div>
<iframe name="iframebox" src="" style="display:none" ></iframe>
<!-- <div>
    <div ng-repeat="image in images">
        <img ng-src="__UPLOAD__/{{ image.url }}" img-name="{{ image.name }}" width="65px" height="65px"/>
    </div>
</div> -->
<script>
        function uploadImgCheck() {
            var exp = /.jpg$|.jpeg$|.gif$|.png$|.bmp$/;
            var file = document.imgUploadForm.avatar.files[0];
            if (file.size > 5 * 1024 * 1024) {
                alert("上传图片不能超过5M");
                return;
            }
            if (!exp.exec(file.type)) {
                alert("图片格式不正确");
                return;
            }
            document.imgUploadForm.submit();
        }

        function expUploadCheck(name) {
            var exp = /.jpg$|.jpeg$|.gif$|.png$|.bmp$/;
            var file = document[name].avatar.files[0];
            if (file.size > 5 * 1024 * 1024) {
                alert("上传图片不能超过5M");
                return;
            }
            if (!exp.exec(file.type)) {
                alert("图片格式不正确");
                return;
            }
            document[name].submit();
        }

        function uploadVideoCheck() {
            var exp = /.mpg$|.mpeg$|.mov$|.mp4$|.avi$|.3gp$/;
            var file = document.videoUploadForm.avatar.files[0];
            if (file.size > 10 * 1024 * 1024) {
                alert("上传视频不能超过10M");
                return;
            }
            if (!exp.exec(file.type)) {
                alert("视频格式不正确");
                return;
            }
            document.videoUploadForm.submit();
        }

        // Update from server script
        function updateImg(res) {
            var resumeId = $('#resumeId').val();
            var appElement = document.querySelector('[ng-controller=resumeController]');
            if (res.msg != null) {
                angular.element(appElement).scope().
                        getAttach(resumeId);
            } else if (res.err != null) {
                alert(res.err);
            }
        }

        //experience upload
        function updateExpImgPC(id,res) {
            var appElement = document.querySelector('[ng-controller=resumeController]');
            if (res.msg != null) {
                angular.element(appElement).scope().
                        getExpAttach(id);
            } else if (res.err != null) {
                alert(res.err);
            }
        }

        $(function() {
            $('body').popover({
                selector : '.link-img',
                html : 'true',
                template : '<div class="popover popover-img" role="tooltip"><h3 class="popover-title"></h3><div class="popover-content"></div></div>',
                direction: 'top',
                trigger : 'focus'
            });
        });
    </script>
</div>
